Business Analytics

Presenting Data Visualizations Effectively

Ayush Patel and Jayati sharma

25 March, 2024

Pre-requisite

You already…

  • Know data wrangling in R
  • Know data visualization in R
  • Understand different types of objects in R

Before we begin

Please install and load the following packages

library(tidyverse)
library(readxl)



Access lecture slide from the course landing page

About Me

I am Ayush.

I am a researcher working at the intersection of data, law, development and economics.

I teach Data Science using R at Gokhale Institute of Politics and Economics

I am a RStudio (Posit) certified tidyverse Instructor.

I am a Researcher at Oxford Poverty and Human development Initiative (OPHI), at the University of Oxford.

Reach me

ayush.ap58@gmail.com

ayush.patel@gipe.ac.in

Why is good visualization so important?

  • Every visualization has a story to tell, which requires skill
  • It is important that the reader presents data effectively, to prompt correct action or discussion
  • Data visualization is not a tool, it is a means for communicating results
  • To understand good visualization, let us take a look at

Say no to 3D graphs!

  • 3D graphs makes the visualizations redundant and complex for no reason
  • The bars at the front hide the ones at the back.
  • Other than looking flashy, they almost never serve the purpose of conveying information
  • The tilt makes it even more difficult to read the values

The more, the merrier?

  • This graphic tries to show MLA salaries
  • The information overload makes it look aesthetically unpleasant
  • With all the information, it looks difficult to understand
  • Provided with such a visual, the audience would not be able to understand anything of substance

Source: jotform

Misleading Visualization

  • Massive growth in iPhone sales, isn’t it?
  • However, a closer look shows that the sales are cumulative over time
  • Cumulative sales don’t necessarily show growth
  • Moreover, the graph does not have a scale on the y-axis
  • It isn’t clear what the graph is trying to show

Source: syntaxtechs

Avoid Pie Charts

  • Pie chart, in most cases, are not the best approach to visualize data.
  • Not only do they add up to 100% in this case, they also make it difficult to comprehend which component has the biggest share
  • When you choose a donut chart, you are essentially asking your audience to measure the arc length to see which has the biggest share
  • Redundant, no? A simple bar chart would have done the job

Source: jotform

Always a zero baseline

  • There seems to be a major difference between democrats and republicans for percent of people who agreed with court
  • However, at a closer look, the visualization has been made with a baseline of 50% which means that the difference is only around 8%
  • Graphs must always be made with a zero baseline to not exaggerate the scale

Source: syntaxtechs

Making a good graph

Content for this topic has been sourced from Cole Nussbaumer Knaflic’s Storytelling with Data: A Data Visualization Guide for Business Professionals’. Please check out his work for detailed information.


Understand the context

  • Your visualization should not just present data
  • It should ask for an action and convey a point
  • For this, you need to know exactly what piece of information you want to convey
  • Your visualizations becomes a means for this communication

Making a good graph

Content for this topic has been sourced from Cole Nussbaumer Knaflic’s Storytelling with Data: A Data Visualization Guide for Business Professionals’. Please check out his work for detailed information.


Choosing the right visual

  • Text isn’t always bad!
  • Line graph for trends over time
  • Bar graph for categories
  • Scatterplot - relationship between two variables
  • Pie charts - what do you think?

Making a good graph

Content for this topic has been sourced from Cole Nussbaumer Knaflic’s Storytelling with Data: A Data Visualization Guide for Business Professionals’. Please check out his work for detailed information.


Avoid clutter

  • Understand and reduce load while making visualizations
  • Only focus on what you want to convey

Making a good graph

Content for this topic has been sourced from Cole Nussbaumer Knaflic’s Storytelling with Data: A Data Visualization Guide for Business Professionals’. Please check out his work for detailed information.


Focus your audience’s attention

  • Need for visual cues
  • Colour is an important tool for that

Let’s replicate some graphs!

  • Download the data
  • Run the code with your own file path to import the data in R
rbi_ccs_data <- read_xlsx(
                          "/Users/jayatisharma/Documents/GitHub/GIPE-Business-Analytics/Consumer Confidence Survey _ Unit Level Data.xlsx"
                          )

Let’s replicate some graphs!

  • Try replicating this graph with the data

Source : Twitter

rbi_ccs_data <- rbi_ccs_data |>
  select(`Average Monthly Income`, `Perception on General Economic condition - compared to one year ago`) |>
  filter(`Perception on General Economic condition - compared to one year ago` != "Remained The Same")

rbi_ccs_percent <- rbi_ccs_data %>%
  group_by(`Average Monthly Income`, `Perception on General Economic condition - compared to one year ago`) %>%
  summarise(Count = n()) %>%
  mutate(Total = sum(Count), Percentage = Count / Total * 100)
ggplot(rbi_ccs_percent, aes(x = `Average Monthly Income`, y = Percentage, fill = `Perception on General Economic condition - compared to one year ago`)) +
  geom_bar(stat = "identity", position = "dodge") +
  theme_minimal() +
  labs(x = "Income Group", y = "Percentage", fill = "Perception") +
  scale_fill_brewer(palette = "Pastel1") +# This changes the color scheme, optional
  coord_flip()